@extends('_layouts.home')

{{--标题--}}
@section('title')个人中心 @stop

@section('head-css')
    @parent
    <link href="{{ asset('cropper/croppic.css') }}" rel="stylesheet">
    @stop

{{--body样式追加--}}
@section('body-class')class="profile-page"@stop

{{--body--}}
@section('body')
    @include('home.doms.nav')
    <div class="wrapper">
        <div id="poster" class="header header-filter" style="background-image: url('{{ asset(user()->poster) }}');"></div>
        <div class="main main-raised">
            <div class="profile-content">
                <div class="container">
                    <div class="row">
                        <div class="profile">
                            <div class="avatar">
                                <img style="cursor: pointer;" id="avatar_btn" src="{{ url(user()->avatar) }}" alt="我的头像" class="img-circle img-responsive img-raised" title="点击更换头像">
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-4 col-sm-offset-4">
                                <div class="form-group">
                                    <div class="togglebutton text-center">
                                        <label>
                                            <b class="man">我是爷们儿</b>&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" checked="checked"><b class="text-primary woman">人家是姑娘</b>
                                        </label>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <input type="email" value="" placeholder="邮箱" class="form-control" />
                                </div>
                                <div class="form-group">
                                    <input type="text" value="" placeholder="昵称" class="form-control" />
                                </div>
                                <div class="form-group">
                                    <input type="text" value="" placeholder="姓名" class="form-control" />
                                </div>
                                <div class="form-group">
                                    <input type="text" value="" placeholder="手机号" class="form-control" />
                                </div>
                                <div class="form-group">
                                    <textarea class="form-control" style="height: 200px;" placeholder="说点什么~"></textarea>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="modal fade" id="poster" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        <i class="material-icons">clear</i>
                    </button>
                    <h4 class="modal-title">上传图片</h4>
                </div>
                <div class="modal-body">
                    <div id="avatar"></div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary btn-simple">选择图片</button>
                    <button type="button" class="btn btn-danger btn-simple" data-dismiss="modal">关闭</button>
                </div>
            </div>
        </div>
    </div>
    @include('home.doms.footer')
@stop

@section('after-body')
    @parent
    <script src="{{ asset('iasset/js/nouislider.min.js') }}" type="text/javascript"></script>
    <script src="{{ asset('iasset/js/material-kit.js') }}" type="text/javascript"></script>
    <script src="{{ asset('cropper/croppic.js') }}" type="text/javascript"></script>
    <script type="text/javascript">
        var avatar = {
            cropData:{
                "type":'avatar',
            },
            cropUrl:'{{ url('/ajax/upload') }}',
            customUploadButtonId:'avatar_btn',
            processInline:true,
            type:'avatar',
            outputUrlId:'avatar_btn',
            modal:true
        }
        var ava = new Croppic('avatar', avatar);
        var poster = {
            cropData:{
                "type":'poster',
            },
            cropUrl:'{{ url('/ajax/upload') }}',
            processInline:true,
            outputUrlId:'poster',
            type:'poster',
            modal:true
        }
        var pos = new Croppic('poster', poster);
    </script>
@stop